package com.example.utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ConstantMsmUtils implements InitializingBean {

    @Value("${aliyun.msm.file.keyid}")
    private String keyid;
    @Value("${aliyun.msm.file.keysecret}")
    private String keysecret;
    @Value("${aliyun.msm.file.TemplateCode}")
    private String templatecode;
    @Value("${aliyun.msm.file.regionid}")
    private String regionid;


    public static String ACCESS_KEY_ID;
    public static String ACCESS_KEY_SECRET;
    public static String ACCESS_TEMPLATE_CODE;
    public static String ACCESS_REGION_ID;

    @Override
    public void afterPropertiesSet() throws Exception {
        ACCESS_KEY_ID = keyid;
        ACCESS_KEY_SECRET = keysecret;
        ACCESS_TEMPLATE_CODE = templatecode;
        ACCESS_REGION_ID = regionid;
    }
}
